package com.example.zookeeperlock.highlock;

import org.I0Itec.zkclient.ZkClient;

/**
 * @Author: zhangrongqing
 * @Date: 2020/9/1 11:01
 * 完成zk简单的管理
 */
public class MyZkClient {

    //在Spring模式下面可以使用配置文件
    public static final String ADDRESS = "127.0.0.1:2181";

    public static final int SESSION_TIMEOUT = 1000;

    public static ZkClient getInstance() {
        return ZkClientInstance.zkClient;
    }

    static class ZkClientInstance {
        private static final ZkClient zkClient = new ZkClient(ADDRESS, SESSION_TIMEOUT);
    }
}
